<div id="bloc_description" style="margin-top:10px;">

	<div class="entete_liste_config" style="width:970px">
		<div class="titre">
			<div style="float:left;">LISTE DES ABONNES</div>
			<div style="float:left;padding-left:40px;font:message-box;letter-spacing:4px; display:none;">[ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789#]</div>
		</div>
		
		<div class="fonction_ajout"><a href="?nom=<?php echo $nom; ?>&amp;page=liste_ajouter">AJOUTER UN ABONN&Eacute;</a></div>
	</div>
	
	<ul id="Nav" style="width: 976px;">
		<li style="width:258px;border-right: 1px solid #96A8B5;">Email</li>
		<li style="width:257px;border-right: 1px solid #96A8B5;">Nom & Pr&eacute;nom</li>
		<li style="width:127px;border-right: 1px solid #96A8B5;">Date abonnement</li>
		<li style="width:100px;border-right: 1px solid #96A8B5;">Langue</li>
		<li style="width:195px;">Options</li>
	</ul>
	
	<span id="resul">
	
		<script language="JavaScript" type="text/JavaScript">
	  		function suppr(format){
	  			if(confirm("Voulez-vous vraiment supprimer cette information ?")) location="?nom=<?php echo $nom; ?>&page=liste_supprimer&action=supprimer&deleteid=" + format;
	  		}	
		</script>
	
        <?php
        	$newsletter = new dc_newsletter_basic();
        	$query_newsletter = "select * from $newsletter->table";
            $resul_newsletter = mysql_query($query_newsletter, $newsletter->link);
            if (!$resul_newsletter) {
    			die('Erreur: ' . mysql_error() . '<br/>Req: ' . $query_newsletter );
			}
            $i = 0;

            while($row = mysql_fetch_object($resul_newsletter)) {
				$i++;
				if(!($i%2)) $fond="ligne_fonce_rub";
  				else $fond="ligne_claire_rub";
				?>
				<ul class="<?php echo $fond; ?>" style="width:976px">
    				<li style="width:250px;">
    					<?php if($newsletter->checkemail($row->email)) {
    						echo $row->email;
    					} else {
    						echo '<span style="color:red;">'.$row->email.'</span>';
    					}?>
    				</li>
    				<li style="width:250px;">
    					<?php 
    					$dc_client = new Client();
    					$query_client = 'select ref from '. $dc_client->table .' where email = "'.$row->email.'"';
    					$result_client = mysql_query($query_client);
    					if (mysql_num_rows($result_client)>0) {
    						echo '<a href="client_visualiser.php?ref='.mysql_result($result_client,0).'">'.$row->nom .' '.$row->prenom.'</a>';
    					} else echo $row->nom .' '. $row->prenom     					
    					?>
    				</li>
    				<li style="width:120px;"><?php echo $row->date ?></li>
    				<li style="width:93px;">
    				<?php 
    					$dc_lang = new Lang();
						$query_lang = 'select * from ' . $dc_lang->table .' where id = ' . $row->langue;
						$resul_lang = mysql_query($query_lang);
						while($rowlang = mysql_fetch_object($resul_lang)) {
                     		echo $rowlang->description;
                   	    }
    				?>
    				
    				</li>
					<li style="width:188px;">
						<a href="mailto:<?php echo $row->email; ?>">Ecrire</a>
						-
						<a href="<?php echo $_SERVER['PHP_SELF'] ?>?nom=<?php echo $nom; ?>&page=liste_modifier&id=<?php echo $row->id; ?>">Editer</a>
						-						
						<a href="#" onclick="suppr('<?php echo($row->id); ?>')">
							Supprimer
						</a>					
					</li>
  				</ul>
				<?php 
			}
			?>
	</span>
</div>